/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Endstart
 * Date: 2021-05-15
 * Time: 19:18
 */
public class q11 {
    private static long[] records = null;

    public static long aa(long n) {
        records = new long[(int) n];
        return aaHelper(n);

    }
    private static long aaHelper(long n) {
        if (n == 0) {
            return 0;
        } else if (n == 1) {
            return 1;
        }

        long value = 0;
        if (records[(int)(n - 2)] == 0) {
            long tmp = aa(n - 2);
            records[(int) (n - 2)] = tmp;
            value += tmp;
        }
        if (records[(int)(n - 1)] == 0) {
            long tmp = aa(n - 1);
            records[(int) (n - 1)] = tmp;
            value += tmp;
        }

        return value;
    }

    public static void main(String[] args) {
        System.out.println(aa(25));
    }
}
